package com.yunze.apiCommon.utils;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Wang
 * @Date: 2025/05/07/9:37
 * @Description: 卡冻结状态解析
 */
@Component
public class CardManageStatusUtil {

    /**
     * 接口返回状态装换成系统状态
     * 同步上游移动接口 卡冻结状态
     *
     * @param StatusCd
     * @return
     */
    public Map<String, Object> geYDCardStatus(String StatusCd) {
        Map<String, Object> Rmap = new HashMap<>();
        Integer statusCode = 7;
        String statusMessage = "";
        //未冻结	0
        //已冻结	1
        if ("0".equals(StatusCd)) {
            statusCode = 0;
            statusMessage = "未冻结";
        } else if ("1".equals(StatusCd)) {
            statusCode = 1;
            statusMessage = "已冻结";
        } else {
            statusCode = 8;
            statusMessage = "未知";
        }
        Rmap.put("statusCode", statusCode);
        Rmap.put("statusMessage", statusMessage);
        return Rmap;
    }

    /**
     * 接口返回状态装换成系统状态
     * 获取 DianXin_CMP_5G 卡冻结状态
     * @param StatusCd
     */
    public  Map<String,Object> getDianXin_CMP_5G_CardStatus(String StatusCd){
        Map<String,Object> Rmap = new HashMap<>();
        //卡冻结状态(0：未冻结 3：客户级机卡绑定断网 4 机卡绑定断网)
        Integer statusCode = 7;
        String statusMessage = "";
        switch (StatusCd){
            case "0":
                statusCode = 0;
                statusMessage = "未冻结";
                break;
            case "3":
            case "4":
                statusCode = 1;
                statusMessage = "已冻结";
                break;
            case "8":
                statusCode = 8;
                statusMessage = "未知";
                break;
        }
        Rmap.put("statusCode",statusCode);
        Rmap.put("statusMessage",statusMessage);
        return Rmap;
    }


}
